package com.zzzyh.forumsystemclient.cotroller;

import com.zzzyh.forumsystemclient.common.AppResult;
import com.zzzyh.forumsystemclient.model.Board;
import com.zzzyh.forumsystemclient.services.IBoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/board")
public class BoardController {

    @Autowired
    private IBoardService boardService;

    @RequestMapping( "/getBoardsByNum")
    public AppResult<List<Board>> getBoardsByNum(int num) {
        return AppResult.success(boardService.getBoardsByNum(num));
    }
}
